# -*- coding: utf-8 -*-
# @Author: obsidian
# @Date:   2016-04-07 22:07:35
# @Last Modified by:   obsidian
# @Last Modified time: 2016-04-07 22:12:21
import matplotlib.pyplot as plt
import numpy as np
def rotate(a,theta):
    b = a
    a[0] = b[0] * np.cos(theta) + b[1] * np.sin(theta)
    a[1] = - b[0] * np.sin(theta) + b[1] * np.cos(theta)
a = [3,4]
plt.plot(a[0],a[1],'or')
rotate(a,np.pi / 4)
plt.plot(a[0],a[1],'og')
plt.show()
